<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>表单</title>
<link rel="stylesheet"
			href="../extjs/resources/css/ext-all.css" type="text/css"></link>
<link rel="stylesheet"
			href="../css/icons/silk.css" type="text/css"></link>
<link rel="stylesheet"
            href="../extjs/ux/css/ux-all.css" type="text/css"></link>
<script type="text/javascript"
			src="../extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../extjs/ext-all.js"></script>
<script type="text/javascript" src="../extjs/ux/ux-all.js"></script>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="../ckfinder/ckfinder.js"></script>
<script type="text/javascript" src="../ckeditor/Ext.form.CKEditor.js"></script>
<script type="text/javascript" src="../js/component/H.js"></script>
<style>
	.testbtn {
		background:url(../image/security.png) !important;
		background-repeat: no-repeat;
		width:64px !important;
		height:64px !important;
	}
	.fc {
		margin:25px 50px 25px 50px;
	}
</style>
<script>
	Ext.onReady(function(){
		Ext.QuickTips.init();
		var fp = new Ext.form.FormPanel({
			layout:'form',
		    title: 'HTML Editor',
		    renderTo: Ext.getBody(),
		    width: 1000,
		    height: 500,
		    frame: true,
		   //layout: 'fit',
		    url:'search.action',
		    items: {
		    	xtype: 'ckeditor', 
		        fieldLabel: 'Editor', 
		        name : 'editor', 
		      //  CKConfig: { 
		            /* Enter your CKEditor config paramaters here or define a custom CKEditor config file. */ 
		      //      customConfig : '../ckeditor/config.js'         
		           // toolbar: 'Default'
		           // height : 200, 
		           // width: 250 
		     //   } 
//		        xtype: 'htmleditor',
//		        id:'editor',
//		        enableColors: true,
//		        enableAlignments: true
		    },
		   buttons:[{
			   text:'submit',
			   handler:function(){
				 //  fp.find('name','editor')[0].setValue('<h3 style="color:blue;">adfadf</h3>');
				 var ck = fp.find('name','editor')[0]
				   alert(ck.getValue()+";\n"+ck.getRawValue());
			//	   fp.find('name','editor')[0].getRawValue();
			   }
		   }]
		});

	/*	var t = document.getElementById('test');
		addEvent(t,'click',clickHandler)
		//Ext.getBody().on('keydown',keyDownHandler,this);
		addEvent(Ext.getBody(),'keydown',keyDownHandler);
		
		function addEvent(elem,type,fn){
			if(elem.addEventListener) elem.addEventListener(type,fn,false);
			if(elem.attachEvent) elem.attachEvent('on'+type,fn);
		}
		function clickHandler(e){
			var e = e||window.enent;
			alert("click:"+this.id);
			if(e.preventDefault) e.preventDefault();
			else e.returnValue =  false;
		}
		function keyDownHandler(e){
			var e = e||window.event;
			var k = e.getKey();
			alert(k);
		}*/
/*		var fomr = new Ext.form.FormPanel({
			width:1000,
			height:700,
			frame:true,
			layout:'form',
			items:[{
				xtype:'ckeditor',
				name:'htmlcode'
				//width:800,
				//height:500
			}],
			renderTo:Ext.getBody()
		});

		var p = new Ext.Panel({
			layout : 'accordion',
			renderTo:Ext.getBody(),
			collapsible : true,
			width : 200,
			height:600,
			defaults : {
				border : false
			},
			layoutConfig : {
				animate : true
			},
			items:[{
				title:'AAA',
				//layout:'form',
				frame:true,
				
				items:[

				{
						xtype:'button',
							tooltip:'按钮功能',
							//repeat:true,
							cls:'fc',
							iconCls:'testbtn',
							handler:function(){
								H.Msg.warning('测试信息',function(btn){
									H.Msg.info('你点了'+btn);
								});
							}
				},{
					xtype:'button',
					tooltip:'按钮功能',
					//repeat:true,
					cls:'fc',
					iconCls:'testbtn',
					handler:function(){
						H.Msg.error('错误信息',function(btn){
							H.Msg.info('你点了'+btn);
						})
					}
				}]

			},{
				title:'BBB',
				//layout:'form',
				frame:true,
				
				items:[

				{
						xtype:'button',
							tooltip:'按钮功能',
							//repeat:true,
							cls:'fc',
							iconCls:'testbtn',
							handler:function(){
								H.Msg.confirm("确定要删除吗？",function(btn){
								//H.Msg.info("测试");
									if(btn=='yes'){
										H.Msg.info('删除');
									}else if(btn=='no'){
										H.Msg.info('不删除');
									}
								});
								
							}
				},{
					xtype:'button',
					tooltip:'按钮功能',
					//repeat:true,
					cls:'fc',
					iconCls:'testbtn',
					handler:function(){
						H.Msg.prompt('请输入你的姓名：',true,function(btn,text){
							if(btn=='ok'){
								H.Msg.info("你的名字是："+text);
							}
						});
					}
				}]

			}]
		});
		//p.show();
		var a = {
			name:'aa',
			age:'24',
			eat:function(){
				alert("a");				
			},
			say:function(){
				
			}
		};
		a.eat();
		a.name;*/
		
	});
</script>
</head>
<body>

</body>
</html>